var express = require('express');
var router = new express.Router();
var Mock = require('mockjs')

//创建一个新数组

router.get('/list', function (req, res) {
  res.send(employees);
})
var employees=require('./data/employees')
router.get('/add',function (request,response) {
  console.log(request.query);
  employees.unshift(request.query)//把数据传到数组的最上面
  response.send({
    addlist:employees,
    flag:true
  })
})

var normalUser=require('./data/normalUsers')
router.get('/adduser',function (request,response) {
  console.log(request.query);
  normalUser.unshift(request.query)
  response.send({
    addUser:normalUser,
    flag:true
  })
})


module.exports= router;
